package top.glkj.hms.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import top.glkj.hms.entity.Permission;
import top.glkj.hms.entity.Resource;

import java.util.List;

/**
 * @author : xgl
 * @version : 0.0.1
 * @date :2020/11/11 2:34
 */
public interface PermissionDao extends JpaRepository<Permission, Long>, JpaSpecificationExecutor<Permission> {
    /**
     * 查询所有包含此路径的权限
     *
     * @param resources 资源路径
     * @return 权限
     */
    public List<Permission> findAllByResourcesIn(List<Resource> resources);

    /**
     * 批量删除权限
     * @param ids 权限id列表
     */
    public void deleteAllByIdIn(List<Long> ids);



}
